<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('支出类合同列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>合同编号：</label>
                                <input type="text" name="contractCode"/>
                            </li>
                            <li>
                                <label>合同名称：</label>
                                <input type="text" name="contractName"/>
                            </li>
                            <li>
                                <label>物资采购订单类型：</label>
                                <select name="contractMaterialType" th:with="type=${@dict.getType('contract_purchase_order_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>合同状态：</label>
                                <select name="contractStatus" th:with="type=${@dict.getType('contract_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>合同类型：</label>
                                <select name="contractTypeName" th:with="type=${@dict.getType('contract_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>合同类别：</label>
                                <select name="contractCategory" th:with="type=${@dict.getType('contract_category')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>招采方式：</label>
                                <select name="contractConferMode" th:with="type=${@dict.getType('zc_mode')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>合同签订年份：</label>
                                <input type="text" name="signYear"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="credit:contractPay:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="credit:contractPay:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="credit:contractPay:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="credit:contractPay:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('credit:contractPay:edit')}]];
        var removeFlag = [[${@permission.hasPermi('credit:contractPay:remove')}]];
        var contractMaterialTypeDatas = [[${@dict.getType('contract_purchase_order_type')}]];
        var contractStatusDatas = [[${@dict.getType('contract_status')}]];
        var contractTypeNameDatas = [[${@dict.getType('contract_type')}]];
        var contractCategoryDatas = [[${@dict.getType('contract_category')}]];
        var contractConferModeDatas = [[${@dict.getType('zc_mode')}]];
        var prefix = ctx + "credit/contractPay";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "支出类合同",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'contractUid',
                    title: '合同uid'
                },
                {
                    field: 'contractCode',
                    title: '合同编号'
                },
                {
                    field: 'contractName',
                    title: '合同名称'
                },
                {
                    field: 'supplierNames',
                    title: '供应商名称'
                },
                {
                    field: 'financialOrgName',
                    title: '资金来源'
                },
                {
                    field: 'lineNames',
                    title: '合同归属'
                },
                {
                    field: 'contractRate',
                    title: '费率'
                },
                {
                    field: 'contractListMoney',
                    title: '清单汇总金额'
                },
                {
                    field: 'contractTotalMoney',
                    title: '合同总额'
                },
                {
                    field: 'contractApplyDate',
                    title: '申报时间'
                },
                {
                    field: 'contractEffectiveDate',
                    title: '启用时间'
                },
                {
                    field: 'contractMemo',
                    title: '备注'
                },
                {
                    field: 'contractIsMaterial',
                    title: '是否运营物资采购合同'
                },
                {
                    field: 'contractMaterialType',
                    title: '物资采购订单类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractMaterialTypeDatas, value);
                    }
                },
                {
                    field: 'contractStatus',
                    title: '合同状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractStatusDatas, value);
                    }
                },
                {
                    field: 'createDate',
                    title: '创建时间'
                },
                {
                    field: 'lastUpdateDate',
                    title: '更新时间'
                },
                {
                    field: 'contractTypeName',
                    title: '合同类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractTypeNameDatas, value);
                    }
                },
                {
                    field: 'contractCategory',
                    title: '合同类别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractCategoryDatas, value);
                    }
                },
                {
                    field: 'contractConferMode',
                    title: '招采方式',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(contractConferModeDatas, value);
                    }
                },
                {
                    field: 'budgetMoney',
                    title: '招标概算(万元)'
                },
                {
                    field: 'controlMoney',
                    title: '控制价(万元)'
                },
                {
                    field: 'reserveFund',
                    title: '含预留金(万元)'
                },
                {
                    field: 'ydUserName',
                    title: '业主代表'
                },
                {
                    field: 'ydOrgName',
                    title: '业代部门'
                },
                {
                    field: 'hostUserName',
                    title: '主办部门经办人'
                },
                {
                    field: 'hostOrgName',
                    title: '主办部门'
                },
                {
                    field: 'hybUserName',
                    title: '合约管理经办人'
                },
                {
                    field: 'hybOrgName',
                    title: '合约管理部门'
                },
                {
                    field: 'contractHostUsertel',
                    title: '经办人电话'
                },
                {
                    field: 'contractIsInvoice',
                    title: '是否增值税专用发票合同'
                },
                {
                    field: 'contractAttribute12',
                    title: '是否违约'
                },
                {
                    field: 'contractAttribute5',
                    title: '财务部是否已审核合同清单'
                },
                {
                    field: 'signYear',
                    title: '合同签订年份'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
